/**
 * 
 */
package systole.domain.clinicalInformation;

import java.io.Serializable;
import systole.domain.persons.Patient;

/**
 * @author jmj
 * 
 */
public class HabitPatient implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 8521218877864576307L;
    private Integer id;
    private Boolean smoking = false;
    private Boolean smoked = false;
    private Integer cigarettesPerDay = 0;
    private Integer yearsOldAtStart = 0;
    private Integer yearsOldAtFinish = 0;
    private Boolean consummingAlcohol = false;
    private Boolean automedication = false;
    private Boolean sedentary = false;
    private String workPlace;
    private Integer blocksWalkedPerDay = 0;
    private Integer stressLevel = 0;
    private Integer angryLevel = 0;
    private Patient patient;

    /**
     *
     */
    public HabitPatient() {
        super();
    }

    /**
     * @param patient
     *
     */
    public HabitPatient(Patient patient) {
        super();
        this.patient = patient;
    }
   
    /**
     * @return the id
     */
    public Integer getId() {
        return this.id;
    }

    /**
     * @param id
     *            the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the patient
     */
    public Patient getPatient() {
        return this.patient;
    }
  
    /**
     * @param patient
     *            the patient to set
     */
    public void setPatient(Patient patient) {
        this.patient = patient;
    }

    /**
     * @return the smoking
     */
    public Boolean getSmoking() {
        return this.smoking;
    }

    /**
     * @param smoking
     *            the smoking to set
     */
    public void setSmoking(Boolean smoking) {
        this.smoking = smoking;
    }

    /**
     * @return the smoked
     */
    public Boolean getSmoked() {
        return this.smoked;
    }

    /**
     * @param smoked
     *            the smoked to set
     */
    public void setSmoked(Boolean smoked) {
        this.smoked = smoked;
    }

    /**
     * @return the cigarettesPerDay
     */
    public Integer getCigarettesPerDay() {
        return this.cigarettesPerDay;
    }

    /**
     * @param cigarettesPerDay
     *            the cigarettesPerDay to set
     */
    public void setCigarettesPerDay(Integer cigarettesPerDay) {
        this.cigarettesPerDay = cigarettesPerDay;
    }

    /**
     * @return the yearsOldAtStart
     */
    public Integer getYearsOldAtStart() {
        return this.yearsOldAtStart;
    }

    /**
     * @param yearsOldAtStart
     *            the yearsOldAtStart to set
     */
    public void setYearsOldAtStart(Integer yearsOldAtStart) {
        this.yearsOldAtStart = yearsOldAtStart;
    }

    /**
     * @return the yearsOldAtFinish
     */
    public Integer getYearsOldAtFinish() {
        return this.yearsOldAtFinish;
    }

    /**
     * @param yearsOldAtFinish
     *            the yearsOldAtFinish to set
     */
    public void setYearsOldAtFinish(Integer yearsOldAtFinish) {
        this.yearsOldAtFinish = yearsOldAtFinish;
    }

    /**
     * @return the consummingAlcohol
     */
    public Boolean getConsummingAlcohol() {
        return this.consummingAlcohol;
    }

    /**
     * @param consummingAlcohol
     *            the consummingAlcohol to set
     */
    public void setConsummingAlcohol(Boolean consummingAlcohol) {
        this.consummingAlcohol = consummingAlcohol;
    }

   
    /**
     * @return the automedication
     */
    public Boolean getAutomedication() {
        return this.automedication;
    }

    /**
     * @param automedication
     *            the automedication to set
     */
    public void setAutomedication(Boolean automedication) {
        this.automedication = automedication;
    }

    /**
     * @return the sedentary
     */
    public Boolean getSedentary() {
        return this.sedentary;
    }

    /**
     * @param sedentary
     *            the sedentary to set
     */
    public void setSedentary(Boolean sedentary) {
        this.sedentary = sedentary;
    }

    /**
     * @return the workPlace
     */
    public String getWorkPlace() {
        return this.workPlace;
    }

    /**
     * @param workPlace
     *            the workPlace to set
     */
    public void setWorkPlace(String workPlace) {
        this.workPlace = workPlace;
    }

    /**
     * @return the blocksWalkedPerDay
     */
    public Integer getBlocksWalkedPerDay() {
        return this.blocksWalkedPerDay;
    }

    /**
     * @param blocksWalkedPerDay
     *            the blocksWalkedPerDay to set
     */
    public void setBlocksWalkedPerDay(Integer blocksWalkedPerDay) {
        this.blocksWalkedPerDay = blocksWalkedPerDay;
    }

    /**
     * @return the stressLevel
     */
    public Integer getStressLevel() {
        return this.stressLevel;
    }

    /**
     * @param stressLevel
     *            the stressLevel to set
     */
    public void setStressLevel(Integer stressLevel) {
        this.stressLevel = stressLevel;
    }

    /**
     * @return the angryLevel
     */
    public Integer getAngryLevel() {
        return this.angryLevel;
    }

    /**
     * @param angryLevel
     *            the angryLevel to set
     */
    public void setAngryLevel(Integer angryLevel) {
        this.angryLevel = angryLevel;
    }

    /**
     * 
     * @return if is smoker
     */
    public boolean isSmoker(){
        return ((this.smoking!=null) && (this.smoking));
    }


    /* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((sedentary == null) ? 0 : sedentary.hashCode());
		result = prime * result + ((smoked == null) ? 0 : smoked.hashCode());
		result = prime * result + ((smoking == null) ? 0 : smoking.hashCode());
		result = prime * result
				+ ((stressLevel == null) ? 0 : stressLevel.hashCode());
		result = prime * result
				+ ((workPlace == null) ? 0 : workPlace.hashCode());
		result = prime
				* result
				+ ((yearsOldAtFinish == null) ? 0 : yearsOldAtFinish.hashCode());
		result = prime * result
				+ ((yearsOldAtStart == null) ? 0 : yearsOldAtStart.hashCode());
		return result;
	}


	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HabitPatient other = (HabitPatient) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (sedentary == null) {
			if (other.sedentary != null)
				return false;
		} else if (!sedentary.equals(other.sedentary))
			return false;
		if (smoked == null) {
			if (other.smoked != null)
				return false;
		} else if (!smoked.equals(other.smoked))
			return false;
		if (smoking == null) {
			if (other.smoking != null)
				return false;
		} else if (!smoking.equals(other.smoking))
			return false;
		if (stressLevel == null) {
			if (other.stressLevel != null)
				return false;
		} else if (!stressLevel.equals(other.stressLevel))
			return false;
		if (workPlace == null) {
			if (other.workPlace != null)
				return false;
		} else if (!workPlace.equals(other.workPlace))
			return false;
		if (yearsOldAtFinish == null) {
			if (other.yearsOldAtFinish != null)
				return false;
		} else if (!yearsOldAtFinish.equals(other.yearsOldAtFinish))
			return false;
		if (yearsOldAtStart == null) {
			if (other.yearsOldAtStart != null)
				return false;
		} else if (!yearsOldAtStart.equals(other.yearsOldAtStart))
			return false;
		return true;
	}

    
}
